{
  "openapi": "3.0.1",
  "info": {
    "title": "CR - ePlanning to Council API",
    "description": "Certificate Register - ePlanning to Council Outbound API",
    "version": "v1"
  },
  "externalDocs": {
    "description": "Find out more about the DA process",
    "url": "https://www.planning.nsw.gov.au/Assess-and-Regulate/Development-Assessment/Your-guide-to-the-DA-process"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/CreateCR/{CaseID}": {
      "post": {
        "summary": "CreateCR",
        "description": "This operation transfers the certificate registration application entered by the certifier from the Online Certificate Registration Service to the council's IT system. Created case by certifier in ePlanning shared to council for further processing.",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified application number or case id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "Used by the API gateway to route the request to the council's API endpoint",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyId",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Information request object",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CR"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "CR created",
            "content": {}
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Certificate Register case already exists",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Mandatory field values not provided",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/Withdraw/{CaseID}": {
      "put": {
        "summary": "Withdraw",
        "description": "This operation transfers the certifier's decision to withdraw the Certificate Registration application from the Online Certificate Registration Service to the council's IT system.",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified application number or case id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "Used by the API gateway to route the request to the council's API endpoint",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyId",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Information request object",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Withdraw"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "CR withdrawn",
            "content": {}
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "CR not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/UpdateAdditionalInfo/{CaseID}": {
      "put": {
        "summary": "UpdateAdditionalInfo",
        "description": "This operation transfers additional information uploaded by the certifier from the Online Certificate Registration Service to the council's IT system.",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified application number or case id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "Used by the API gateway to route the request to the council's API endpoint",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IdempotencyId",
            "in": "header",
            "description": "Unique Id for this request. Allows the API to respond in an idempotent way if it has already been called with these parameters and prevents duplicate processing. Typically a UUID such as \"63a9ba30-7a4b-4fac-b343-d1f05cf089f1\"",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Information request object",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdditionalInfo"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Case updated",
            "content": {}
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Case not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "components": {
    "schemas": {
      "Location": {
        "required": [
          "address",
          "lga"
        ],
        "type": "object",
        "properties": {
          "address": {
            "maxLength": 250,
            "type": "string",
            "description": "Address where the development is happening",
            "example": "19-33 Elizabeth Street, Narrandera, 2700",
            "minLength": 1
          },
          "addressDetail": {
            "$ref": "#/components/schemas/AddressDetail"
          },
          "LotList": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LotSectionPlan"
            }
          },
          "lga": {
            "maxLength": 30,
            "type": "string",
            "description": "Local Government Area under which this application falls",
            "example": "PENRITH",
            "minLength": 1
          },
          "isPrimary": {
            "type": "boolean",
            "description": "The primary address if multiple"
          }
        }
      },
      "AddressDetail": {
        "required": [
          "latitude",
          "longitude",
          "postCode",
          "state",
          "streetName",
          "suburb"
        ],
        "type": "object",
        "properties": {
          "complexUnitType": {
            "type": "string"
          },
          "complexLevelType": {
            "type": "string"
          },
          "complexLevelNumber": {
            "type": "string"
          },
          "complexUnitIdentifier": {
            "type": "string"
          },
          "streetNumber1": {
            "type": "string"
          },
          "streetNumber2": {
            "type": "string"
          },
          "streetName": {
            "type": "string",
            "minLength": 1
          },
          "streetSuffix": {
            "type": "string"
          },
          "streetType": {
            "type": "string"
          },
          "suburb": {
            "type": "string",
            "minLength": 1
          },
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "wkid": {
            "type": "string"
          },
          "cadastralID": {
            "type": "string"
          },
          "gurasID": {
            "type": "string"
          },
          "primarySecondary": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "minLength": 1
          },
          "postCode": {
            "type": "number"
          }
        }
      },
      "LotSectionPlan": {
        "required": [
          "lotsectionplan"
        ],
        "type": "object",
        "properties": {
          "lotsectionplan": {
            "type": "string",
            "example": "1/-/SPXXXXX",
            "minLength": 1
          }
        }
      },
      "Person": {
        "required": [
          "familyName",
          "firstName",
          "email"
        ],
        "type": "object",
        "properties": {
          "firstName": {
            "maxLength": 20,
            "type": "string",
            "minLength": 1
          },
          "otherName": {
            "maxLength": 20,
            "type": "string"
          },
          "familyName": {
            "maxLength": 20,
            "type": "string",
            "minLength": 1
          },
          "contactNumber": {
            "maxLength": 10,
            "minLength": 8,
            "pattern": "^[0-9]+$",
            "type": "string"
          },
          "email": {
            "maxLength": 250,
            "type": "string",
            "format": "email",
            "minLength": 1
          }
        }
      },
      "DevelopmentType": {
        "type": "object",
        "properties": {
          "developmentType": {
            "maxLength": 200,
            "type": "string",
            "minLength": 1
          }
        }
      },
      "CommonApplicationType": {
        "type": "object",
        "properties": {
          "commonApplicationType": {
            "type": "string"
          }
        }
      },
      "DownloadableDocument": {
        "required": [
          "documentName",
          "documentType",
          "documentURL",
          "uploadedDateTime"
        ],
        "type": "object",
        "properties": {
          "documentName": {
            "maxLength": 150,
            "type": "string",
            "minLength": 1
          },
          "documentType": {
            "maxLength": 100,
            "type": "string",
            "minLength": 1
          },
          "uploadedDateTime": {
            "type": "string",
            "format": "date-time",
            "minLength": 1
          },
          "documentURL": {
            "maxLength": 500,
            "type": "string",
            "description": "URL of the document to be downloaded",
            "format": "uri",
            "minLength": 1
          },
          "documentSize": {
            "description": "This indicates the file size of the document in bytes",
            "type": "number"
          },
          "updatedBy": {
            "type": "string",
            "example": "Council"
          }
        }
      },
      "AdditionalInfo": {
        "required": [
          "caseStatus",
          "responseDate"
        ],
        "type": "object",
        "properties": {
          "caseStatus": {
            "maxLength": 100,
            "type": "string",
            "description": "Status of the request for additional information",
            "example": "Complete",
            "minLength": 1
          },
          "childCaseID": {
            "type": "string",
            "description": "An AI case id for RFI"
          },
          "responseDate": {
            "type": "string",
            "description": "Date and time of response",
            "format": "date",
            "minLength": 1
          },
          "responseDetails": {
            "maxLength": 1500,
            "type": "string",
            "description": "Additional information description provided by the applicant"
          },
          "Documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          },
          "updatedBy": {
            "$ref": "#/components/schemas/UpdatedBy"
          }
        }
      },
      "UpdatedBy": {
        "title": "UpdatedBy",
        "type": "object",
        "properties": {
          "person": {
            "$ref": "#/components/schemas/PersonBody"
          }
        }
      },
      "PersonBody": {
        "title": "PersonBody",
        "required": [
          "email",
          "familyName",
          "firstName"
        ],
        "type": "object",
        "properties": {
          "firstName": {
            "maxLength": 20,
            "type": "string",
            "example": "John",
            "minLength": 1
          },
          "familyName": {
            "maxLength": 20,
            "type": "string",
            "example": "Smith",
            "minLength": 1
          },
          "email": {
            "maxLength": 250,
            "type": "string",
            "description": "User must be registered in the planning portal",
            "example": "john.smith@gmail.com",
            "minLength": 1
          },
          "contactNumber": {
            "maxLength": 10,
            "minLength": 8,
            "pattern": "^[0-9]+$",
            "type": "string"
          }
        }
      },
      "CR": {
        "required": [
          "caseStatus",
          "certificateType",
          "certifierDetails",
          "contactDetails",
          "certificateDetails",
          "siteAddresses",
          "paymentInformation"
        ],
        "type": "object",
        "properties": {
          "caseStatus": {
            "maxLength": 80,
            "type": "string",
            "description": "Status of the DA case",
            "example": "Submitted",
            "minLength": 1
          },
          "caseSubmittedDate": {
            "minLength": 1,
            "type": "string",
            "description": "This is to track the application submitted date."
          },
          "certificateType": {
            "type": "string",
            "description": "This is to track the certificate types - Complying Development Certificate - Construction Certificate - Occupation Certificate - Subdivision Certificate - Subdivision Works Certificate - Other",
            "example": "Refer to description for values",
            "minLength": 1
          },
          "enterCertificateType": {
            "maxLength": 50,
            "type": "string",
            "description": "Required only when user selects OTHER in Certificare type"
          },
          "isExistingCR": {
            "type": "boolean",
            "description": "This indicates if the user is applying for a modification CR or a new CR. 'true' value indicates modification CR and 'false' value indicates new CR. This is applicable for CDC CRs only."
          },
          "existingCRRegistrationDate": {
            "type": "string",
            "description": "This indicates on what date was the application to be modified registered. This is applicable for modification CDC CRs only (isExistingCR = true).",
            "format": "date"
          },
          "existingCRNumber": {
            "type": "string",
            "description": "This indicates the CR application number to be modified. This is applicable for modification CDC CRs only (isExistingCR = true)."
          },
          "proposedModification": {
            "type": "string",
            "description": "This indicates the description of the proposed modification. This is applicable for modification CDC CRs only."
          },
          "wasExistingCRAppliedViaNSWPortal": {
            "type": "boolean",
            "description": "This indicates if the CR applied for was via the NSW planning portal. This is applicable only when applying for modification CDC CRs only (isExistingCR = true)."
          },
          "existingNSWPortalCRNumber": {
            "type": "string",
            "description": "This indicates the application number. This is applicable only when isExistingCR is selected as Modification to complying development registration Certificate and when wasExistingCRAppliedViaNSWPortal is true."
          },
          "contactDetails": {
            "$ref": "#/components/schemas/ContactDetails"
          },
          "certificateIssuedBy": {
            "type": "boolean",
            "description": "Is the certificate issued by the contact"
          },
          "certifierDetails": {
            "$ref": "#/components/schemas/CertifierDetails"
          },
          "DADetermined": {
            "type": "boolean",
            "description": "Has the DA been determined"
          },
          "existingDANumber": {
            "maxLength": 20,
            "type": "string",
            "description": "Required only if user selected Yes for Has the DA been determined"
          },
          "dateOfDADetermination": {
            "type": "string",
            "description": "Required only if user selected Yes for Has the DA been determined",
            "format": "date",
            "example": "20/07/2020"
          },
          "cdcDetermined": {
            "type": "boolean",
            "description": "Has the CDC been determined"
          },
          "existingCDCNumber": {
            "maxLength": 40,
            "type": "string",
            "description": "Required only if user selected Yes for Has the CDC been determined"
          },
          "dateOfCDCDetermination": {
            "type": "string",
            "description": "Required only if user selected Yes for Has the CDC been determined?",
            "format": "date",
            "example": "20/07/2020"
          },
          "certificateDetails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Certificatedetails"
            }
          },
          "builderDetails": {
            "$ref": "#/components/schemas/Builderdetails"
          },
          "siteAddresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Location"
            }
          },
          "commonApplicationTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommonApplicationType"
            },
            "description": "This is to track the common Application types.This is applicable for CR-CC, CR-OC, CR-PCA and is required for it's corresponding parent cases that are created after 1st of September'23. Example values are 1. Advertising and signage 2. Alterations or additions to an existing building or structure 3. Change of use of land or a building or the classification of a building under the Building Code of Australia 4. Demolition 5. Erection of a new structure 6. Hours of operation and trading 7. Subdivision 8. Temporary building, structure or use"
          },
          "subdivisionTypes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "This is to track the appropriate subdivision types. This is applicable when 'Subdivision' is one of the common application type('commonApplicationTypes').This is not applicable for CR-CC & CR-OC.Example values are 1. Strata Title 2. Community Title 3. Torrens Title 4. Stratum Title"
          },
          "numOfExistingLots": {
            "type": "integer",
            "description": "This is to track the number of existing lots. This is applicable when 'Subdivision' is one of the common application type('commonApplicationTypes').This is not applicable for CR-CC & CR-OC."
          },
          "numOfProposedLots": {
            "type": "integer",
            "description": "This is to track the number of proposed lots. This is applicable when 'Subdivision' is one of the common application type('commonApplicationTypes').This is not applicable for CR-CC & CR-OC."
          },
          "developmentTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DevelopmentType"
            }
          },
          "isDevAffectingExistingBuilding": {
            "type": "boolean",
            "description": "It infers that is Existing building affected by the development or not. If the value is Yes then Record of inspection document type is mandatory document to be provided. isDevAffectingExistingBuilding is mandatory field for Construction Certificate only."
          },
          "estimatedCostOfWork": {
            "type": "string",
            "description": "Required only if Subdivision Works Certificate is selected for certificate type, currency format"
          },
          "developmentDescription": {
            "maxLength": 1500,
            "type": "string"
          },
          "paymentInformation": {
            "$ref": "#/components/schemas/Payment"
          },
          "isResend": {
            "type": "boolean",
            "description": "This is to track if application details are resent. True indicates a retriggered event."
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          },
          "declarations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CertifierDetails": {
        "required": [
          "accreditationNumber",
          "address",
          "certifierPerson"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "This is to track the salutation of user - Miss - Mr - Mrs - Ms",
            "example": "Refer to description for values"
          },
          "certifierPerson": {
            "$ref": "#/components/schemas/Person"
          },
          "address": {
            "maxLength": 250,
            "type": "string",
            "minLength": 1
          },
          "accreditationNumber": {
            "maxLength": 50,
            "type": "string",
            "description": "BPB accreditation number",
            "minLength": 1
          },
          "companyName": {
            "maxLength": 250,
            "type": "string"
          }
        }
      },
      "ContactDetails": {
        "required": [
          "address",
          "contactPerson"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "This is to track the salutation of user - Miss - Mr - Mrs - Ms",
            "example": "Refer to description for values"
          },
          "contactPerson": {
            "$ref": "#/components/schemas/Person"
          },
          "address": {
            "maxLength": 250,
            "type": "string",
            "minLength": 1
          },
          "companyname": {
            "maxLength": 50,
            "type": "string"
          }
        }
      },
      "Payment": {
        "required": [
          "payerName",
          "paymentAmount",
          "paymentTowards",
          "trxDate",
          "trxReference"
        ],
        "type": "object",
        "properties": {
          "payerName": {
            "type": "string",
            "description": "Payer full name",
            "minLength": 1
          },
          "paymentTowards": {
            "type": "string",
            "description": "payment made towards council, council name",
            "minLength": 1
          },
          "paymentAmount": {
            "type": "number",
            "description": "Transaction amount"
          },
          "trxReference": {
            "type": "string",
            "description": "Transaction reference number, BankRecieptNumber",
            "minLength": 1
          },
          "trxDate": {
            "type": "string",
            "description": "Transaction date",
            "format": "date",
            "example": "20/07/2020",
            "minLength": 1
          }
        }
      },
      "Certificatedetails": {
        "required": [
          "applicantAddress",
          "applicantName",
          "certRefNumber",
          "certificateIssued",
          "isDevelopmentTypeResidential"
        ],
        "type": "object",
        "properties": {
          "certRefNumber": {
            "maxLength": 50,
            "type": "string",
            "minLength": 1
          },
          "certificateIssued": {
            "type": "boolean",
            "description": "Was certificate issue"
          },
          "dateOfCertificateIssue": {
            "type": "string",
            "description": "Required if the certificate issued is Yes",
            "format": "date",
            "example": "20/07/2020"
          },
          "dateCertificateApplied": {
            "type": "string",
            "description": "Required if the certificate issued is Yes",
            "format": "date",
            "example": "20/07/2020"
          },
          "applicantName": {
            "maxLength": 20,
            "type": "string",
            "minLength": 1
          },
          "companyname": {
            "maxLength": 50,
            "type": "string"
          },
          "applicantAddress": {
            "maxLength": 250,
            "type": "string",
            "minLength": 1
          },
          "dateofWorkCommencement": {
            "type": "string",
            "description": "Required if the certificate issued is Yes",
            "format": "date",
            "example": "20/07/2020"
          },
          "principalCertifyingAuthority": {
            "maxLength": 20,
            "type": "string",
            "description": "Required if the certificate issued is Yes"
          },
          "isDevelopmentTypeResidential": {
            "type": "boolean",
            "description": "dev type"
          },
          "dateofCertificateNotification": {
            "type": "string",
            "description": "Required if the certificate issued is Yes",
            "format": "date",
            "example": "20/07/2020"
          }
        }
      },
      "Builderdetails": {
        "type": "array",
        "description": "applicable when IsDevelopmentTypeResidential is Yes and user entered a date for Date that works are proposed to commence",
        "items": {
          "$ref": "#/components/schemas/Builder"
        }
      },
      "Builder": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "This is to track the salutation of user - Miss - Mr - Mrs - Ms",
            "example": "Refer to description for values"
          },
          "builderPerson": {
            "$ref": "#/components/schemas/Person"
          },
          "address": {
            "maxLength": 250,
            "type": "string"
          },
          "licensenumber": {
            "maxLength": 20,
            "type": "string"
          },
          "insurerDetail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InsurerDetails"
            }
          }
        }
      },
      "InsurerDetails": {
        "type": "object",
        "properties": {
          "insurerRegisteredBusinessName": {
            "maxLength": 250,
            "type": "string",
            "description": "Required when user entered a date for Date that works are proposed to commence and if IsDevelopmentTypeResidential is Yes"
          },
          "insurerlicensenumber": {
            "maxLength": 20,
            "type": "string",
            "description": "Required when user entered a date for Date that works are proposed to commence and if IsDevelopmentTypeResidential is Yes, EntityID"
          }
        }
      },
      "Withdraw": {
        "required": [
          "caseStatus",
          "updatedBy",
          "withdrawalDate"
        ],
        "type": "object",
        "properties": {
          "caseStatus": {
            "type": "string",
            "description": "Status of the case",
            "example": "Withdrawn",
            "minLength": 1
          },
          "withdrawalDate": {
            "type": "string",
            "description": "Date of withdrawal",
            "format": "date",
            "minLength": 1
          },
          "updatedBy": {
            "$ref": "#/components/schemas/Person"
          }
        }
      },
      "Error": {
        "required": [
          "errorCode",
          "statusCode"
        ],
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "example": 404
          },
          "message": {
            "type": "string",
            "example": "Internal Server error 19876"
          },
          "activityId": {
            "type": "string",
            "example": "00000011-0ab-xy00-0000-500000000000"
          },
          "errorCode": {
            "type": "string",
            "example": "DPE_TMS01",
            "minLength": 1
          },
          "errorDetails": {
            "type": "string",
            "example": "Inner Exceptions, Stack Trace, etc"
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "api-key",
        "in": "header"
      }
    }
  }
}